import React from 'react';
import { FlatList, RefreshControl, View} from 'react-native';
import CheckBoxItem from './CheckBoxItem';

function  maintainList() {
  const arr=[];
  for (let i=0;i<2000;i++) {
    arr.push({
      id:i,name:'维修'+i
    })
  }
  return arr
}


export default class FlatListWithCheck extends React.Component {



  arr = maintainList();

  render() {
    return (
        <FlatList
          style={{marginBottom: 50}}
          data={this.arr}
          renderItem={(item) => this.renderListRow(item)}
          keyExtractor={(item) => {
            return item.id+''
          }}
          initialNumToRender={10}
          refreshControl={
            <RefreshControl
              refreshing={false}
              onRefresh={() => this.onRefresh}
              tintColor="#999"
              colors={['#999', '#999', '#999']}
              progressBackgroundColor="#fff"
            />
          }
        />
    )
  }

  renderListRow = ({item}) => {
    return <CheckBoxItem item={item}/>
  }
}
